<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
        <form action="http://www.itcast.cn">
            <input type="submit" value="注册">
        </form>
        <script>
            // 阻止默认行为  e.preventDefault
            const form = document.querySelector('form')
            form.addEventListener('submit', function (e) {
                e.preventDefault() // 阻止默认行为，提交
            })
        </script>

    </body>
</html>